<template>
    <view  class="enroll-view">
        <!-- <zEnrollItemPanel :ref="'enrollPanel'" :questions="questions" :isEdit="false"/>
        <button @click="getEnrollMeta">获取报名元数据</button>
        <button @click="getEnrollData">获取报名数据</button> -->
        <zEnrollAnsPanel :answer="answer" />
    </view>
</template>
<script>
    import zEnrollItemPanel from "../../components/basic/zenrollitempanel";
    import datetimePicker from "../../components/basic/datetime-picker"
    import zEnrollAnsPanel from "../../components/basic/zenrollanspanel"
    export default {
        components: {
            zEnrollItemPanel,
            datetimePicker,
            zEnrollAnsPanel
        },
        onLoad : function(){
            this.questions = eval('[{"question":"请输入任意的文字","key":"q2","type":"ztext","answer":{"restrict":0,"length":20,"empty":false}},{"question":"请随便选个选项","key":"q3","type":"zradio","answer":{"choices":["选项1","选项2"]}},{"question":"请随便选个选项","key":"q4","type":"zcheckbox","answer":{"choices":["选项1","选项2","选项3"],"minNum":1,"maxNum":3}},{"question":"请随便选一项","key":"q5","type":"zpicker","answer":{"choices":["选项1","选项2","选项3"]}},{"question":"选一个时间点","key":"q6","type":"ztime","answer":{"precision":31,"interval":false}},{"question":"选一个时间区间","key":"q7","type":"ztime","answer":{"precision":31,"interval":true}},{"question":"上传个图片","key":"q8","type":"zpicture","answer":{"maxSize":32,"empty":false}},{"key":"q9","type":"zdescpic","answer":{"height":"234px","width":"290px","src":{"filename":"-1863921558test11587877849496.jpeg","hostId":"A"}}},{"question":"选一个地方","key":"q10","type":"zlocation","answer":{"precision":2}},{"question":"您的民族是？","key":"q11","type":"zpicker","answer":{"choices":["汉族","蒙古族","回族","藏族","维吾尔族","苗族","彝族","壮族","布依族","朝鲜族","满族","侗族","瑶族","白族","土家族","哈尼族","哈萨克族","傣族","黎族","僳僳族","佤族","畲族","高山族","拉祜族","水族","东乡族","纳西族","景颇族","柯尔克孜族","土族","达斡尔族","仫佬族","羌族","布朗族","撒拉族","毛南族","仡佬族","锡伯族","阿昌族","普米族","塔吉克族","怒族","乌孜别克族","俄罗斯族","鄂温克族","德昂族","保安族","裕固族","京族","塔塔尔族","独龙族","鄂伦春族","赫哲族","门巴族","珞巴族","基诺族"]}},{"question":"您的政治面貌是？","key":"q12","type":"zpicker","answer":{"choices":["中共党员","中共预备党员","共青团员","民革党员","民盟盟员","民建会员","民进会员","农工党党员","致公党党员","九三学社社员","台盟盟员","无党派人士","群众"]}}]')
            this.answer = eval('[{"que":"请输入任意的文字","ans":"范德萨范德萨","type":"ztext"},{"que":"请随便选个选项","ans":"选项1","type":"zradio"},{"que":"请随便选个选项","ans":["选项1","选项2"],"type":"zcheckbox"},{"que":"请随便选一项","ans":"选项2","type":"zpicker"},{"que":"选一个时间点","ans":"2020年04月26日17时23分","type":"ztime"},{"que":"选一个时间区间","ans":"2020年04月26日17时23分到2020年04月26日17时23分","type":"ztime"},{"que":"上传个图片","ans":{"filename":"-173723111test11587893017292.png","hostId":"A"},"type":"zpicture"},{"que":"选一个地方","ans":"甘肃省天水市麦积区","type":"zlocation"},{"que":"您的民族是？","ans":"汉族","type":"zpicker"},{"que":"您的政治面貌是？","ans":"中共党员","type":"zpicker"}]');
        },
        data() {
            return {
                questions : [],
                answer : []
            }
        },
        methods: {
            getEnrollMeta : function(){
                console.log(JSON.stringify(this.$refs['enrollPanel'].getQue()))
            },
            getEnrollData : function(){
                console.log(JSON.stringify(this.$refs['enrollPanel'].getAns()))
            }
        }
    }
</script>
<style>
    .test{
        text-align: center;
        padding: 10px 0;
    }
    button{
        margin: 20upx;
        font-size: 28upx;
    }
    .enroll-view{
		width: 100%;
		flex-direction: column;
	}
</style>